package com.Event;

import org.springframework.context.ApplicationListener;
import org.springframework.stereotype.Component;

/**
 * @author cyt
 * @create 2020-08-01 17:34
 */
@Component
public class MsgListener implements
        ApplicationListener<MsgSendEvent> {
    /**
     * 当监听的事件发生后执行，
     * @param msgSendEvent
     */
    @Override
    public void onApplicationEvent(MsgSendEvent msgSendEvent) {
        MsgSendEvent event = msgSendEvent;
        System.out.println("lister = > " + event.getTo());
    }
}
